import Request from '@/request'

export const adminLogin = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/admins/login', data)
}

// 获取管理员列表
export const adminList = <T extends object, R>(
  data: T
): Promise<IResponse<IList<R>>> => {
  return Request.get('/admins/list', data)
}

export const addADmin = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/admins/add', data)
}

export const updateAdmin = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/admins/update', data)
}

export const deleteAdmin = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/admins/delete', data)
}
